package ru.isys.xml;

import java.util.HashMap;
import java.util.List;



public class XmlItem
{
    private String fullName;
    private String name;
    private String value;
    private HashMap <String,String> attrs;
    private String xmlns;
    boolean isModelField = false;
    String type;
    String constraint;
    boolean readOnly;
    boolean required;
    String className;
    String label;
    String hint;
    String alert;
    
    public XmlItem(){
        this("", "", "", new HashMap<String, String>());
    }
    
    public XmlItem(String fullName){
        this(fullName, "", "", new HashMap<String, String>());
    }
    
    public XmlItem(String fullName, String value){
        this(fullName, value, "", new HashMap<String, String>());
    }
    
    public XmlItem(String fullName, String value,String xmlns){
        this(fullName, value, xmlns, new HashMap<String, String>());
    }
    public XmlItem(String fullName, String value, String xmlns, HashMap <String,String> attrs){
        this.attrs=attrs;
        this.fullName=fullName;
        this.value=value;
        this.xmlns=xmlns;
    }

    public String getFullName()
    {
        return fullName;
    }

    public void setFullName(String fullName)
    {
        this.fullName = fullName;
    }

    public String getValue()
    {
        return value;
    }

    public void setValue(String value)
    {
        this.value = value;
    }

    public HashMap<String, String> getAttrs()
    {
        return attrs;
    }

    public void addAttribute(String name, String value){
        this.attrs.put(name, value);
    }    
    
    public void setAttrs(HashMap<String, String> attrs)
    {
        this.attrs = attrs;
    }

    public String getXmlns()
    {
        return xmlns;
    }

    public void setXmlns(String xmlns)
    {
        this.xmlns = xmlns;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public boolean isModelField()
    {
        return isModelField;
    }

    public void setModelField(boolean isModelField)
    {
    	System.out.println("CALL setModelField " + getName());
        this.isModelField = isModelField;
    }

    public String getType()
    {
        return type;
    }

    public void setType(String type)
    {        
        this.type = type;
    }

    public String getConstraint()
    {
        return constraint;
    }

    public void setConstraint(String constraint)
    {
        this.constraint = constraint;
    }

    public boolean isReadOnly()
    {
        return readOnly;
    }

    public void setReadOnly(boolean readOnly)
    {
        this.readOnly = readOnly;
    }

    public boolean isRequired()
    {
        return required;
    }

    public void setRequired(boolean required)
    {
        this.required = required;
    }

    public String getClassName()
    {
        return className;
    }

    public void setClassName(String className)
    {
        this.className = className;
    }

    public String getLabel()
    {
        return label;
    }

    public void setLabel(String label)
    {
        this.label = label;
    }

    public String getHint()
    {
        return hint;
    }

    public void setHint(String hint)
    {
        this.hint = hint;
    }

    public String getAlert()
    {
        return alert;
    }

    public void setAlert(String alert)
    {
        this.alert = alert;
    }    
}
